{include file='header.tpl'}
{include file='left.tpl'}
<div id="left-area">
   
        <div class="breadcrumb">
            <span class="raquo"></span><a href="/">Главная</a>
            <span class="raquo"> &raquo; </span><a href="{geturl controller='index' action='search'}">Поиск</a>   
        </div>
        <div class="related-items clearfix" style="padding: 17px 0 35px;">
        <form method="get" id="searchform" action="{geturl controller="index" action="search"}">
        
       
            
            <input type="hidden" name="filter_name" style="width:100%" value="{$filter_name}">
            {if $filter_material}<input type="hidden" name="material" value="{$filter_material}">{/if}
            {if $filter_tags}<input type="hidden" name="tags" value="{$filter_tags}">{/if}
        
        
            </form>
         <h1 class="prof-title">Поиск</h1>
          <div class="product-filter">
          <div class="sort">Сортировка:      <select onchange="location = this.value;">
                <option value="{if $cat}{else}{geturl action='search'}{/if}?sort=date_add&amp;order=DESC{if $type}&type={$type}{/if}{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" {if $sort=='date_add' && $order=='DESC'}selected="selected"{/if}>По умолчанию</option>
                <option value="{if $cat}{else}{geturl action='search'}{/if}?sort=price&amp;order=ASC{if $type}&type={$type}{/if}{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" {if $sort=='price' && $order=='ASC'}selected="selected"{/if}>Цена (по возрастанию)</option>
                <option value="{if $cat}{else}{geturl action='search'}{/if}?sort=price&amp;order=DESC{if $type}&type={$type}{/if}{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" {if $sort=='price' && $order=='DESC'}selected="selected"{/if}>Цена (по убыванию)</option>
                <option value="{if $cat}{else}{geturl action='search'}{/if}?sort=date_add&amp;order=ASC{if $type}&type={$type}{/if}{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" {if $sort=='date_add' && $order=='ASC'}selected="selected"{/if}>Дата добавления (по возрастанию)</option>
                <option value="{if $cat}{else}{geturl action='search'}{/if}?sort=date_add&amp;order=DESC{if $type}&type={$type}{/if}{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" {if $sort=='date_add' && $order=='DESC'}selected="selected"{/if}>Дата добавления (по убыванию)</option>
            </select>
        </div>
         <div class="type">На странице:      <select onchange="location = this.value;">
                <option value="{if $cat}{else}{geturl action='search'}{/if}?type=0{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" >Все работы</option>
                <option value="{if $cat}{else}{geturl action='search'}{/if}?type=1{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" {if $type=='1'}selected{/if}>Готовые работы</option>
                <option value="{if $cat}{else}{geturl action='search'}{/if}?type=2{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" {if $type=='2'}selected{/if}>На заказ</option>
                <option value="{if $cat}{else}{geturl action='search'}{/if}?type=3{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" {if $type=='3'}selected{/if}>Для примера</option>
            
            </select>
        </div>
        </div>
                {if $products}
    {foreach from=$products item=d}
        <div class="main-product" id="tr_{$d->getId()}">
            <a href="{getsuburl route='shopproduct' name=$d->nameshop action='item' id=$d->getId()}" id="name_{$d->getId()}">
               <img class="img" src="{$d->logo}" alt="{$d->name}" style="width:137px;height:121px;">
                  <span class="price-tag"><span class="currency">{$currency}</span>								 
                    {$d->price}        </span>
                                           
            </a>
            <h4 class="title">
                <a href="{getsuburl route='shopproduct' name=$d->nameshop action='item' id=$d->getId()}" id="name_{$d->getId()}">{$d->name}</a>
                    <br>
                <a href="{getsuburl route='shop' name=$d->nameshop}" style="font-size:11px;color:#7C7C7C !important;">({$d->nameshop})</a>
            </h4>
            
            <div class="et-links clearfix">
              <a href="javascript:void();" onclick="addCart({$d->getId()},'cart')" class="add-to-cart et-shop-item">В корзину</a>
                <a href="{getsuburl route='shopproduct' name=$d->nameshop action='item' id=$d->getId()}" id="name_{$d->getId()}" class="more-info">Описание</a>
            </div> <!-- end .et-links -->
           

        </div>
    {/foreach}
                {elseif $user}
    {foreach from=$user item=d}
        <div class="main-product" id="tr_{$d->getId()}">
            <a href="{getsuburl route='shop' name=$d->nameshop}" id="name_{$d->getId()}">
               <img class="img" src="{$d->photo}" alt="{$d->nameshop}" style="width:137px;height:121px;">
             
                                           
            </a>
            <h4 class="title">
                <a href="{getsuburl route='shop' name=$d->nameshop}" id="name_{$d->getId()}">{$d->first_name} {$d->last_name}</a>
                  <br>
                <a href="{getsuburl route='shop' name=$d->nameshop}" style="font-size:11px;color:#7C7C7C !important;">({$d->nameshop})</a>   
            </h4>
            
            <div class="et-links clearfix">
              <a href="{getsuburl route='shop' name=$d->nameshop}" class="add-to-cart et-shop-item">Магазин</a>
                <a href="{getsuburl route='shop' name=$d->nameshop action="profile"}" id="name_{$d->getId()}" class="more-info">Профиль</a>
            </div> <!-- end .et-links -->
           

        </div>
    {/foreach} 
                {else}
                    <h1>По вашему запросу ничего не задано!</h1>
                    {/if}
</div>
 
 {if $pages->count_pages > 1}
<div class="wp-pagenavi">
<span class="pages">Страница {$pages->active} из {$pages->count_pages}</span> 
<!-- Previous page link -->
 <a href="{geturl action='search'}?p={$pages->start}{if $search_type}&search_type={$search_type}{/if}{if $type}&type={$type}{/if}{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" class="last">«Первая</a> 
{if $pages->previous }
<a href="{geturl action='search'}?p={$pages->active-1}{if $search_type}&search_type={$search_type}{/if}{if $type}&type={$type}{/if}{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" >«</a> 
{/if}
<!-- Numbered page links -->
{section name=foo start=$pages->start loop=$pages->end step=1}
{if $smarty.section.foo.index != $pages->active }
<a href="{geturl action='search'}?p={$smarty.section.foo.index}{if $search_type}&search_type={$search_type}{/if}{if $type}&type={$type}{/if}{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" class="page smaller">{$smarty.section.foo.index}</a> 
{else}
 <span class="current">{$smarty.section.foo.index}</span>
{/if}
{/section}
<!-- Next page link -->
{if $pages->active < $pages->count_pages}
<a href="{geturl action='search'}?p={$pages->active+1}{if $search_type}&search_type={$search_type}{/if}{if $type}&type={$type}{/if}{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" class="nextpostslink">»</a>
 {/if}
 <a href="{geturl action='search'}?p={$pages->count_pages}{if $search_type}&search_type={$search_type}{/if}{if $type}&type={$type}{/if}{if $filter_name}&filter_name={$filter_name}{/if}{if $filter_tags}&tags={$filter_tags}{/if}{if $filter_material}&material={$filter_material}{/if}" class="last">Последняя»</a> 
 </div>
 {/if}
<div class="botline"></div>

</div>
 
{include file='footer.tpl'}